package com.sync.utils.project.wechat.service.impl;

import com.sync.utils.common.base.service.impl.BaseServiceImpl;
import com.sync.utils.project.demo.mapper.AppMapper;
import com.sync.utils.project.demo.pojo.AppDto;
import com.sync.utils.project.wechat.agent.AuthAgent;
import com.sync.utils.project.wechat.pojo.AccessTokenReq;
import com.sync.utils.project.wechat.pojo.AccessTokenRes;
import com.sync.utils.project.wechat.service.AuthService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * TODO
 *
 * @Author YWF
 * @Date 2025/5/6 15:00
 */
@Slf4j
@RequiredArgsConstructor
@Service
@Transactional(rollbackFor = Exception.class)
public class AuthServiceImpl extends BaseServiceImpl<AppMapper, AppDto> implements AuthService {

    @Autowired
    private AuthAgent authAgent;

    @Override
    public AccessTokenRes getAccessToken(AccessTokenReq request) {
        return authAgent.getAccessToken(request);
    }
}
